
package com.dhcc.bpm.modules.content.mapper;

import com.dhcc.bpm.modules.content.entity.DocDirectory;
import com.dhcc.bpm.modules.content.vo.DocDirectoryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName DocDirectoryMapper
 * @Description  文档目录 Mapper 接口
 * @Author lijiacheng
 * @Date 2020/2/21 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */

public interface DocDirectoryMapper extends BaseMapper<DocDirectory> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param docDirectory
	 * @return
	 */
	List<DocDirectoryVO> selectDocDirectoryPage(IPage page, DocDirectoryVO docDirectory);

	/**
	 * 文档目录树形结构
	 * @return
	 */
	List<DocDirectoryVO> tree();

	/**
	 * 根据目录编号查询文档信息
	 * @param opcDirectoryCode
	 * @return
	 */
    DocDirectory selectMenuBycode(String opcDirectoryCode);

	/**
	 * 根据三级目录删除四级节点
	 * @param docCode
	 */
	void deleteDocDirectoryChildByCode(String docCode);

	/**
	 * 根据文档编号查询文档一级目录
	 * @param docCode
	 */
	DocDirectory selectParentByChildcode(String docCode);

	/**
	 * 根据父id查询一级目录信息
	 * @param parentId
	 * @return
	 */
	DocDirectory selectdocByParentId(String parentId);


	/**
	 * 删除文档目录ByProductCode
	 * @param productCode
	 * @return
	 */
	int removeDocByProductCode(String productCode);

	/**
	 * 下线文档目录ByProductCode
	 * @param productCode
	 */
	int updateDocByProductCode(String productCode);

	/**
	 * @Description TODO
	 * @Author xiafayu
	 * @Date 2020/4/21 17:05
	 * @param docCode
	 * @return com.dhcc.bpm.modules.content.vo.DocDirectoryVO
	 * @throws
	 **/
	DocDirectoryVO findByDocCode(@Param("docCode") String docCode, @Param("productCode") String productCode, @Param("apiId") String apiId);
	/**
	 * @Description TODO
	 * @Author xiafayu
	 * @Date 2020/4/21 17:05
	 * @param docDirectory
	 * @return com.dhcc.bpm.modules.content.vo.DocDirectoryVO
	 * @throws
	 **/
	DocDirectoryVO findByDoc(@Param("docDirectory") DocDirectory docDirectory);

	/**
	 * @Description TODO
	 * @Author xiafayu
	 * @Date 2020/4/21 17:05
	 * @param docCode
	 * @return com.dhcc.bpm.modules.content.vo.DocDirectoryVO
	 * @throws
	 **/
	List<DocDirectoryVO> findByApiCode(@Param("docCode") String docCode);

	int updateByDocCode(@Param("docDirectory") DocDirectory docDirectory);
}
